The admin dashboard (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Fer-2202/Proyecto_Final/llms.txt
Use this file to discover all available pages before exploring further.
DashboardAdmin) is a protected single-page interface that gives authenticated administrators full CRUD access to every entity in the system, live operational statistics, advanced filtering, and a complete audit log.
Dashboard overview
DashboardAdmin (frontend/src/components/admin/DashboardAdmin.jsx) fetches all entity lists in parallel on mount:
Statistics panel
DashboardStats renders eight metric cards, each showing a live count and a simulated month-over-month growth indicator:
| Metric | Icon | Data source |
|---|---|---|
| Total usuarios | Users | user-profiles |
| Total entradas | Ticket | tickets |
| Total animales | Activity | animals |
| Total visitas | Calendar | visits |
| Total órdenes | ShoppingCart | orders |
| Total especies | Star | species |
| Total hábitats | Eye | habitats |
| Total secciones | DollarSign | sections |
- Densidad de población — animals per habitat (
animals / habitats) - Tasa de ocupación — visits as a percentage of total tickets
- Diversidad de especies — unique species count
- Eficiencia operativa — habitats per section, expressed as a percentage
Sidebar navigation and entity tabs
TheDashboardSidebar lists all entity tabs. The active tab drives the table, filter, and form shown in the main content area:
| Tab key | Entity label | Editable fields |
|---|---|---|
tickets | Entrada | name, description, price, total_slots, currency |
sections | Sección | name |
habitats | Hábitat | name, nums_animals, description, section |
animals | Animal | name, age, species, conservation_status, habitat |
visits | Visita | day, total_slots |
orders | Orden | email, status, visit, user |
species | Especie | name, scientific_name, description, image |
conservation-status | Estado de Conservación | name (IUCN code) |
provinces | Provincia | name |
user-profiles | Perfil de Usuario | user, province, phone, address, birth_date, profile_picture, bio |
audit-log | Log de Auditoría | read-only |
exhibits | Exhibición | value, label, title |
CRUD operations
Create, update, and delete are dispatched through three maps that route the active tab to the correct API function:multipart/form-data. All others are sent as plain JSON.
Delete operations require confirmation via a SweetAlert2 dialog before the API call is made.
Audit logs
Every create and update action performed through the dashboard writes an entry to the audit log:AuditLog Django model stores each entry:
Logs page (frontend/src/pages/Admin/Logs.jsx) fetches the log from GET /api/admin/audit-logs/ and displays it in a table with columns: ID, User, Action, Timestamp.
Delete operations are not currently written to the audit log in
DashboardAdmin.handleDelete. Only create and update actions produce audit entries.Role-based access
User roles are managed through Django’s built-inGroup model. Each UserProfile holds a many-to-many relation to groups:
useUserRoles hook and passes roleNames to DashboardSidebar to control which sections are visible. The AdminLayout component applies an animated loading screen on entry to prevent flash-of-unauthenticated-content during the transition.
Institutional transparency
The public-facing “Quiénes Somos” section includes a transparency hub powered by several tab components:| Component | Content |
|---|---|
TabInformes | Institutional transparency reports |
TabDocumentos | Official documents |
TabCertificaciones | Certifications |
TabPoliticas | Policies |
TabOrganigramaTestimonios | Organisation chart and testimonials |
TransparenciaTabs component and are accessible to any visitor without authentication.